package com.wuseguang.springcloud.controller;


import com.wuseguang.springcloud.Filter.RequestParameterWrapper;
import com.wuseguang.springcloud.service.TeacherRatingLimitService;
import com.wuseguang.springcloud.util.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 教师评分限制表 前端控制器
 * </p>
 *
 * @author 
 * @since 2020-06-24
 */
@RestController
@RequestMapping("/teacherRatingLimit")
public class TeacherRatingLimitController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private TeacherRatingLimitService teacherRatingLimitServiceImpl;

    /**
     * 添加教师评分限制
     * @param request
     * @param teacherScore 任课老师分数
     * @param classTeacherScore 班主任评分
     * @return
     */
    @RequestMapping("/addTeacherRatingLimit")
    public Result addTeacherRatingLimit(RequestParameterWrapper request,
                                        @RequestParam(value = "teacherScore",defaultValue = "0",required = false) String teacherScore,
                                        @RequestParam(value = "classTeacherScore",defaultValue = "0",required = false) Integer classTeacherScore){
        logger.info("添加教师评分限制");
        String schoolId = request.getParam("schoolId");
        return teacherRatingLimitServiceImpl.addTeacherRatingLimit(schoolId,teacherScore,classTeacherScore);
    }

}

